Name:		python3
Version:	3.9.12
Release:	1%{?dist}
Summary:	Python high-level scripting language

License:	custom
URL:		https://www.python.org
Source0:	https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tar.xz

Provides: python(abi) = 3.9
Provides: python39 = %{version}-%{release}
Provides: python3-setuptools
BuildRequires: libffi-devel openssl-devel

%global _python_bytecompile_errors_terminate_build 0

%global __python %{_bindir}/python39

%description
Python is a programming language that lets you work quickly and integrate
systems more effectively.

%prep
%setup -q -n Python-%{version}
sed -i 's/\/usr\/local\/bin\/python/\/usr\/bin\/env python3/g' Lib/cgi.py

%build
%configure --with-platlibdir=lib64 --enable-shared --with-ensurepip=install
make %{?_smp_mflags}

%install
%make_install
sed -i 's/\/usr\/bin\/python/\/usr\/bin\/python3.9/g' %{buildroot}/usr/bin/pip3 %{buildroot}/usr/bin/pip3.9

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%license LICENSE
/usr/bin/2to3
/usr/bin/2to3-3.9
/usr/bin/idle3
/usr/bin/idle3.9
/usr/bin/pydoc3
/usr/bin/pydoc3.9
/usr/bin/python3
/usr/bin/python3-config
/usr/bin/python3.9
/usr/bin/python3.9-config
/usr/bin/pip3
/usr/bin/pip3.9

/usr/lib64/libpython3*
/usr/lib64/pkgconfig
/usr/lib64/python3.9
/usr/lib/python3.9
/usr/include/python3.9
%{_mandir}/man1/python3*

%changelog

